356ecb6685cf76a4f4b7d0216bfcd6b7d819bd44,server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java,TreeActionTest,direct_children_of_a_view,#,242

Before Change


    db.commit();
    componentDb.indexProjects();

    InputStream responseStream = ws.newRequest()
      .setMediaType(MediaTypes.PROTOBUF)
      .setParam(PARAM_STRATEGY, "children")
      .setParam(PARAM_BASE_COMPONENT_ID, "view-uuid")
      .setParam(Param.TEXT_QUERY, "name")
      .execute().getInputStream();
    WsComponents.TreeWsResponse response = WsComponents.TreeWsResponse.parseFrom(responseStream);

    assertThat(response.getComponentsList()).extracting("id").containsExactly("project-uuid-1-copy", "sub-view-uuid");
    assertThat(response.getComponentsList()).extracting("refId").containsExactly("project-uuid-1", "");

After Change


    db.commit();
    componentDb.indexProjects();

    TreeWsResponse response = call(ws.newRequest()
      .setParam(PARAM_STRATEGY, "children")
      .setParam(PARAM_BASE_COMPONENT_ID, "view-uuid")
      .setParam(Param.TEXT_QUERY, "name"));

    assertThat(response.getComponentsList()).extracting("id").containsExactly("project-uuid-1-copy", "sub-view-uuid");
    assertThat(response.getComponentsList()).extracting("refId").containsExactly("project-uuid-1", "");